//
//  ZYCLectureRecordHeaderView.m
//  ZDSC
//
//  Created by ZDTX on 2021/8/23.
//

#import "ZYCLectureRecordHeaderView.h"

@implementation ZYCLectureRecordHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.userInteractionEnabled = YES;
        self.backgroundColor = [UIColor clearColor];
        [self addSubview:self.titleButton];
        [self.titleButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self).offset(5.0f);
            make.centerX.equalTo(self);
        }];
    }
    return self;
}

- (UIButton *)titleButton {
    if (!_titleButton) {
        _titleButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_titleButton setTitleColor: HEX_RGB(@"#E93C06") forState:UIControlStateNormal];
        [_titleButton addTarget:self action:@selector(clickBtnAction:) forControlEvents:UIControlEventTouchUpInside];
        _titleButton.titleLabel.font = kCustomFont(@"PingFangSC-Light", 14.0f);
    }
    return _titleButton;
}


- (void)clickBtnAction:(UIButton *)sender{
    if ([self.delegate respondsToSelector:@selector(lectureRecordHeaderViewDidExpect)]) {
        [self.delegate lectureRecordHeaderViewDidExpect];
    }
}


@end
